#ifndef _ICETask_H
#define _ICETask_H

#include <thread_pool.hpp>
#include <osg/Group>
#include <osg/Node>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgDB/ReadFile>
#include <osgGA/OrbitManipulator>

namespace ICE
{
    struct ITask
    {
        virtual void doTask(dw::ThreadPool* pThreadPool)=0;
        virtual dw::Task* getTask()=0;
        virtual void* getData()=0;
    };

    struct OsgTask: public ITask
    {
        ~OsgTask();

        struct jobData
        {
            osgViewer::ViewerBase* pView;
            osg::Group* pSceneRoot;
            dw::ThreadPool* pThreadPool;
            dw::Task*  pTask;
        };

        virtual void doTask(dw::ThreadPool* pThreadPool);

        virtual dw::Task* getTask();

        virtual void* getData();

        private:
            dw::Task* _task;
            jobData* _data;
    };
};



#endif // !_ICETask_H